import {
    createRouter,
    createWebHistory,
} from "vue-router";

const routes = [
    {
        path:'/',
        name: 'loginPage',
        component:()=>import('../pages/LoginPage.vue')
    },
    {
        path: "/helperPage",
        name: 'helperPage',
        component:()=>import('../pages/HelperPage.vue')
    },
    {
        path:'/userPage',
        name:'userPage',
        component:()=>import('../pages/UserPage.vue'),
        children:[
            {
                path: '',
                name:'userDefault',
                redirect:'/userPage/takeTaskPage'
            },
            {
                path:'takeTaskPage',
                name:'takeTaskPage',
                component:()=>import('../pages/user_children_pages/TakeTaskPage.vue'),
            },
            {
                path:'newTaskPage',
                name:'newTaskPage',
                component:()=>import('../pages/user_children_pages/NewTaskPage.vue'),
            },
            {
                path:'accountPage',
                name:'accountPage',
                component:()=>import('../pages/user_children_pages/AccountPage.vue')
            }
        ]
    }

]

const router = createRouter({
    history: createWebHistory(), // history模式
    routes,
})

export default router